﻿
using Microsoft.AspNetCore.Mvc;
using WxProxy.Services;

namespace WxProxy.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class WxController : ControllerBase
    {
        private readonly WxJsSdkService _wx;

        public WxController(WxJsSdkService wx)
        {
            _wx = wx;
        }

        [HttpGet("jsconfig")]
        public async Task<IActionResult> GetJsConfig(string url)
        {
            var config = await _wx.GetJsConfigAsync(url);
            return Ok(config);
        }
    }
}